<?php

namespace App\Listeners;

use App\Common\Libs\ArrayHelper;
use App\Common\Libs\Json;
use Illuminate\Support\Facades\Log;

class BaseListener
{
    public function saveFileLog($class, $params, $channel = 'event')
    {
        if (is_array($params) || is_object($params)) {
            $params = Json::encode(ArrayHelper::toArray($params));
        }

        Log::channel($channel)->info($class . ' handle : ' . $params);

        return true;
    }
}
